package qq.adapter;

import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

public class LeftClassAdapter extends RecyclerView.Adapter<LeftClassAdapter.ViewHolder> {

    private List<ClassesListResultBean.DataBean> mclassList;

    static class ViewHolder extends RecyclerView.ViewHolder{
        TextView classname;
        TextView name;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            classname =(TextView) itemView.findViewById(R.id.left_tv_left_name);
            name =(TextView) itemView.findViewById(R.id.left_tv_left_creattime);
        }
    }
    public LeftClassAdapter(List<ClassesListResultBean.DataBean> list){
        mclassList=list;
    }
    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
        View view= LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.class_left_item,viewGroup,false);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
        ClassesListResultBean.DataBean listResultBean = mclassList.get(i);
        Log.e("cch",listResultBean.getClassesName());
        viewHolder.classname.setText(listResultBean.getClassesName().toString());
//        viewHolder.name.setText(listResultBean.getLeader().toString());

    }

    @Override
    public int getItemCount() {
        return mclassList.size();
    }



}
